package jnzb.ui.event;

import java.awt.BorderLayout;

import javax.swing.JFrame;

import jnzb.JNZB;

/**
 * Main frame for event window
 * 
 * @author AA1
 * 
 */
public class EventFrame extends JFrame {

	private EventPanel eventPanel;

	public EventFrame() {
		create();
	}

	private void create() {
		// just hide when closed
		this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

		this.setTitle("jNZB " + JNZB.VERSION + " - Events");

		this.setResizable(true);
		
		this.setLayout(new BorderLayout());
		this.eventPanel = new EventPanel();
		this.add(eventPanel, BorderLayout.CENTER);

		// Locate components relative to each other
		this.pack();
		// Centre on the screen - important this is done after the pack()
		this.setLocationRelativeTo(null);

		this.setVisible(false);
	}

	public EventPanel getEventPanel(){
		return this.eventPanel;
	}
}
